package common;

import java.io.Serializable;

/**
 * This class represents exam template.
 * Actually teacher is building this template for exam executions
 *
 */
public class Exam implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5755300508635657528L;

	private int id;
	private int solveTime;
	private String notesForTeacher;
	private String notesForStudent;
	private String teacherName; 
	private int teacherID;
	private Question questions[];
	private String subjectName;
	private String courseName;

	/**
	 * Exam ID getter
	 * @return
	 */
	public int getId() {
		return id;
	}
	
	/**
	 * Exam ID setter
	 * @param id
	 */
	public void setId(int id) {
		if(id>9999 && id<1000000)
		this.id = id;
	}
	
	/**
	 * Solve Time getter
	 * @return
	 */
	public int getSolveTime() {
		return solveTime;
	}
	
	/**
	 * Solve Time setter
	 * @param solveTime
	 */
	public void setSolveTime(int solveTime) {
		this.solveTime = solveTime;
	}
	
	/**
	 * Notes For Teacher getter
	 * @return
	 */
	public String getNotesForTeacher() {
		return notesForTeacher;
	}
	
	/**
	 * Notes For Teacher setter
	 * @param notesForTeacher
	 */
	public void setNotesForTeacher(String notesForTeacher) {
		this.notesForTeacher = notesForTeacher;
	}
	
	/**
	 * Notes For Student getter
	 * @return
	 */
	public String getNotesForStudent() {
		return notesForStudent;
	}
	
	/**
	 * Notes For Student setter
	 * @param notesForStudent
	 */
	public void setNotesForStudent(String notesForStudent) {
		this.notesForStudent = notesForStudent;
	}
	
	/**
	 * Teacher's Name getter
	 * @return
	 */
	public String getTeacherName() {
		return teacherName;
	}
	
	/**
	 * Teacher's Name setter
	 * @param teacherName
	 */
	public void setTeacherName(String teacherName) {
		this.teacherName = teacherName;
	}
	
	/**
	 * Teacher's ID getter
	 * @return
	 */
	public int getTeacherID() {
		return teacherID;
	}

	/**
	 * Teacher's ID setter
	 * @param teacherID
	 */
	public void setTeacherID(int teacherID) {
		this.teacherID = teacherID;
	}
	
	/**
	 * Questions list getter
	 * @return
	 */
	public Question[] getQuestions() {
		return questions;
	}

	/**
	 * Questions list setter
	 * @param questions
	 */
	public void setQuestions(Question[] questions) {
		this.questions = questions;
	}
	
	/**
	 * Default constructor
	 */
	public Exam() {
	}
	
	/**
	 * Parameterized constructor
	 * @param questions
	 */
	public Exam(Question questions[]) {
		this.questions = questions;
	}
	
	/**
	 * Course ID getter
	 * @return ID of the course that was set in ID property
	 * @see ID property must be set in order to get Course ID
	 */
	public int getCourseID() {
		return  (id%10000)/100;
	}
	
	/**
	 * Subject ID getter
	 * @return ID of the subject that was set in ID property
	 * @see ID property must be set in order to get Subject ID
	 */
	public int getSubjectID() {
		return  id/10000;
	}

	/**
	 * Exam ID getter
	 * @return ID of the exam that was set in ID property
	 * @see ID property must be set in order to get Exam ID
	 */
	public int getExamID() {
		return id%100;
	}
	
	/**
	 * Subject name getter
	 * @return
	 */
	public String getSubjectName() {
		return subjectName;
	}

	/**
	 * Subject name setter
	 * @param subjectName Name of the subject
	 */
	public void setSubjectName(String subjectName) {
		this.subjectName = subjectName;
	}

	/**
	 * Course name getter
	 * @return
	 */
	public String getCourseName() {
		return courseName;
	}

	/**
	 * Course name setter
	 * @param courseName Name of the course
	 */
	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}
	
}
